import {Database} from "../config"
import mongoose,{Schema} from 'mongoose'
import {IUser} from "@/models/user";
import handlebars from 'handlebars'

async function init() {
    await Database.connect()

}

interface Thing extends mongoose.Document{
    name: string
    binary?: Buffer
    living: boolean
    updated: Date
    age: number
    mixed?: Schema.Types.Mixed
    _someId?: Schema.Types.ObjectId
    decimal?: Schema.Types.Decimal128
    array: any[]
    ofString: string[]
    ofNumber: number[]
    ofDates: Date[]
    ofBuffer: any[]
    ofBoolean: boolean[]
    ofMixed?: Schema.Types.Mixed[],
    ofObjectId?: Schema.Types.ObjectId[],
    ofArrays: any[][],
    ofArrayOfNumbers: number[][]
    nested: any,
    map: Map<any, any>
    mapOfString: Map<string, string>
}

/*init().then(() => {
    const schema = new Schema<Thing>({
        name: String,
        binary: Buffer,
        living: Boolean,
        updated: {type: Date, default: Date.now},
        age: { type: Number, min: 18, max: 65},
        mixed: Schema.Types.Mixed,
        _someId: Schema.Types.ObjectId,
        decimal: Schema.Types.Decimal128,
        array: [],
        ofString: [String],
        ofNumber: [Number],
        ofDates: [Date],
        ofBuffer: [Buffer],
        ofBoolean: [Boolean],
        ofMixed: [Schema.Types.Mixed],
        ofObjectId: [Schema.Types.ObjectId],
        ofArray: [[]],
        ofArrayOfNumbers: [[Number]],
        nested: {
            stuff: { type: String, lowercase: true, trim: true}
        },
        map: Map,
        mapOfString: {
            type: Map,
            of: String
        }
    })
    const Thing = mongoose.model<Thing>('Thing', schema)
    const m = new Thing
    m.name = 'Stone'
    m.age = 125
    m.updated = new Date()
    m.binary = Buffer.alloc(0)
    m.living = false
    m.mixed = undefined

})*/

//handlebars.compile()



